// 页面路径：store/index.js
import Vue from "vue";
import Vuex from "vuex";
import user from "./modules/user";
import getters from "./getters";
import persistence from "vuex-uniapp-persistence";
Vue.use(Vuex);

const store = new Vuex.Store({
  state: {
    // 安全区域数据
    safeArea: uni.getWindowInfo().safeArea,
    // 右上角胶囊按钮数据
    capButton: uni.getMenuButtonBoundingClientRect(),
  },
  // 持久化插件
  plugins: [persistence()],

  getters,
  modules: {
    user,
  },
});

export default store;
